# -*- coding: utf-8 -*-
# @Time    : 2022/5/25 11:15
# @Author  : leijiu
# @Email   : 517711635@qq.com
# @File    : page_goods_type_add.py
# @Software: PyCharm
"""
添加商品类型页面
"""
from selenium.webdriver.common.by import By
from page.page_base import BasePage   #引入基类

class GoodsTypeAdd(BasePage):

        #添加类型定位器
        #类型名称输入框定位器
    ele_goodstyename_locator = (By.CSS_SELECTOR,"body > div.main-div > form > table > tbody > tr:nth-child(1) > td:nth-child(2) > input[type=text]")
        #确定定位器
    ele_goodstyebtn_locator = (By.CSS_SELECTOR, "body > div.main-div > form > table > tbody > tr:nth-child(4) > td > input:nth-child(2)")

        #输入品牌类型
    def type_name(self):
        self.driver.find_element(*self.ele_goodstyename_locator).send_keys("将也")
        #点击确定
    def add_type_btn(self):
        self.driver.find_element(*self.ele_goodstyebtn_locator).click()
        #编辑
    def alter_type(self):
        self.driver.find_element(*self.ele_goodstyename_locator).clear()
        self.driver.find_element(*self.ele_goodstyename_locator).send_keys("有讯")
        self.driver.find_element(*self.ele_goodstyebtn_locator).click()